<template>
  <div>
      <el-container>
              <el-aside width="200px">
                  <el-menu
                    :default-active="this.$route.path"
                    class="el-menu-vertical-demo"
                    @select="onSelect"
                  >
                     <el-menu-item index="/">
                        <i class="el-icon-menu"></i>
                        <span slot="title">后台首页</span>
                    </el-menu-item>
                    <el-menu-item index="/home/photo">
                        <i class="el-icon-menu"></i>
                        <span slot="title">相册管理</span>
                    </el-menu-item>
                    <el-menu-item index="/home/malllist">
                        <i class="el-icon-menu"></i>
                        <span slot="title">商品列表</span>
                    </el-menu-item>
                  </el-menu>
              </el-aside>
              <el-main>
                  <router-view></router-view>
              </el-main>
      </el-container>
  </div>
</template>

<script>
export default {
  methods:{
    onSelect(index){
      // console.log(index);
      this.$router.push(index)
    }
  }
}
</script>

<style>
  .el-aside {
    background-color: white;
    color: #333;
    text-align: center;
    height: 90vh;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
</style>